Skip to content

Commit 6216995

Browse files
committed
Merge branch 'master' into configurable-tags-column
2 parents 93cd1ae + 8a61c91 commit 6216995

File tree

18 files changed

+518
-127
lines changed

18 files changed

+518
-127
lines changed

DOCS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ require('orgmode').setup({
216216
f = {
217217
label = 'Export to RTF format',
218218
action = function(exporter)
219-
local current_file = vim.fn.bufname()
219+
local current_file = vim.api.nvim_buf_get_name(0)
220220
local target = vim.fn.fnamemodify(current_file, ':p:r')..'.rtf'
221221
local command = {'pandoc', current_file, '-o', target}
222222
local on_success = function(output)

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,22 @@ set conceallevel=2
227227
set concealcursor=nc
228228
```
229229

230+
##### Jumping to file path is not working for paths with forward slash
231+
If you are using Windows, paths are by default written with backslashes.
232+
To use forward slashes, you must enable `shellslash` option (see `:help 'shellslash'`).
233+
234+
```lua
235+
vim.opt.shellslash = true
236+
```
237+
238+
Or if you are using `init.vim`:
239+
240+
```vim
241+
set shellslash
242+
```
243+
244+
More info on issue [#281](https://github.com/nvim-orgmode/orgmode/issues/281#issuecomment-1120200775)
245+
230246
### Features (TL;DR):
231247
* Agenda view
232248
* Search by tags/keyword

doc/orgmode.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ For example, lets add option to export to `rtf` format via `pandoc`:
401401
f = {
402402
label = 'Export to RTF format',
403403
action = function(exporter)
404-
local current_file = vim.fn.bufname()
404+
local current_file = vim.api.nvim_buf_get_name(0)
405405
local target = vim.fn.fnamemodify(current_file, ':p:r')..'.rtf'
406406
local command = {'pandoc', current_file, '-o', target}
407407
local on_success = function(output)

lua/orgmode/capture/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function Capture:_get_refile_vars()
134134
local template = vim.api.nvim_buf_get_var(0, 'org_template') or {}
135135
local file = vim.fn.fnamemodify(template.target or config.org_default_notes_file, ':p')
136136
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, true)
137-
local org_file = File.from_content(lines, 'capture', vim.fn.bufname())
137+
local org_file = File.from_content(lines, 'capture', utils.current_file_path())
138138
local item = nil
139139
if org_file then
140140
item = org_file:get_headlines()[1]
@@ -242,7 +242,7 @@ function Capture:_refile_to(file, lines, item, destination_line)
242242
return false
243243
end
244244

245-
local is_same_file = file == vim.fn.bufname()
245+
local is_same_file = file == utils.current_file_path()
246246
local cur_win = vim.api.nvim_get_current_win()
247247

248248
if is_same_file and item then

lua/orgmode/capture/templates.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local config = require('orgmode.config')
22
local Date = require('orgmode.objects.date')
3+
local utils = require('orgmode.utils')
34
local expansions = {
45
['%f'] = function()
56
return vim.fn.expand('%')
@@ -26,7 +27,7 @@ local expansions = {
2627
return string.format('[%s]', Date.now():to_string())
2728
end,
2829
['%a'] = function()
29-
return string.format('[[file:%s +%s]]', vim.fn.bufname(), vim.api.nvim_win_get_cursor(0)[1])
30+
return string.format('[[file:%s +%s]]', utils.current_file_path(), vim.api.nvim_win_get_cursor(0)[1])
3031
end,
3132
}
3233

lua/orgmode/clock/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Clock:org_clock_goto()
6868
utils.echo_info('No running clock, this is the most recently clocked task')
6969
end
7070

71-
if vim.fn.bufname() ~= active_headline.file then
71+
if utils.current_file_path() ~= active_headline.file then
7272
vim.cmd('edit ' .. vim.fn.fnameescape(active_headline.file))
7373
end
7474
vim.fn.cursor({ active_headline.range.start_line, 0 })

0 commit comments

Comments
 (0)